﻿var xmlHttp;
function GetXmlHttpOject() {
    try {
        // Firefox, Opera, Safari
        xmlHttp = new XMLHttpRequest();

    } catch (e) {
        // Internet Exploer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return xmlHttp;
}


function GetComment() {
    GetXmlHttpOject();
    xmlHttp.onreadystatechange = function () {
        if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
            document.getElementById("contents_chat").innerHTML = xmlHttp.responseText;
        }
    }
    xmlHttp.open("POST", "Ajax/Chatting.aspx", true);
    xmlHttp.send(null);
    setTimeout("GetComment()", 2000);
}